﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace ComicsEditor
{
    public class ActiveDashedLine : PageObject
    {
        public DashedLine Line;
        public ActivePoint Start;
        public ActivePoint End;

        public ActiveDashedLine(Page Page, Point Start, Point End) : base(Page)
        {
            Line = new DashedLine(Page, Start, End);
            this.Start = new ActivePoint(Page, Start);
            this.Start.ActivePointMove += delegate(ActivePoint activePoint, Point oldCenter, Point newCenter)
            {
                Line.Start = newCenter;
            };
            this.End = new ActivePoint(Page, End);
            this.End.ActivePointMove += delegate(ActivePoint activePoint, Point oldCenter, Point newCenter)
            {
                Line.End = newCenter;
            };
        }

        public override void Dispose()
        {
            Line.Dispose();
            Start.Dispose();
            End.Dispose();
            base.Dispose();
        }

        public override void Show()
        {
            base.Show();
            Start.Show();
            End.Show();
        }

        public override void Hide()
        {
            base.Hide();
            Start.Hide();
            End.Hide();
        }
    }
}
